Skip to content

feat(thumb)!: replace the video string with StreamThumbnailSource - #259

Merged
xsahil03x merged 5 commits into
mainfrom
feat/thumbnail-source
Nov 26, 2026
Merged

xsahil03x merged 5 commits into
mainfrom
feat/thumbnail-source

Conversation

@xsahil03x

@xsahil03x xsahil03x commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Part of FLU-1373

What

  • Adds StreamThumbnailSource with .network(url, headers:), .file(path) and .contentUri(uri) (Android only), taken as source / sources by every StreamThumbnail method.
  • The source kind is sent to each platform, which opens the video only that way. Network sources are fetched over http/https only; anything else fails with an UNSUPPORTED_SOURCE PlatformException. On Linux, videos are read from single-file containers only (no HLS/DASH). On Windows, file sources must be absolute paths on a local drive.
  • Breaking: video, videos and headers are removed, and source / sources are required, so every caller says where a video comes from.
  • Example app: Android Gradle 9.5.0 / AGP 9.3.1 / Kotlin 2.4.20 (matching the chat sample), since current stable Flutter refuses the old versions.
  • Fixes Android 10+ failing to thumbnail a local video when maxWidth or maxHeight is 0.

Why

A string doesn't say whether it is a URL to fetch or a path to open, so each platform guessed. The caller knows, so it now says so — the same shape video_player uses (networkUrl / file / contentUri).

Verified

  • flutter analyze --fatal-infos and unit tests (38) pass.
  • Integration tests pass on macOS, iOS simulator and an Android emulator, including the remote-video test and a test that calls the platform directly with a non-http network request. The Windows-only file-path tests have not been run; CI only builds Windows.
  • Web compiled only; Linux and Windows are built by the native-builds workflow on this PR.

🤖 Generated with Claude Code

@xsahil03x
xsahil03x requested a review from a team as a code owner November 25, 2026 11:03
@github-actions github-actions Bot added the ready Pull request ready to be reviewed label Nov 25, 2026
@codecov-commenter

codecov-commenter commented Nov 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.71%. Comparing base (b0dfa16) to head (d6eebe8).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #259      +/-   ##
==========================================
+ Coverage   75.62%   75.71%   +0.09%     
==========================================
  Files         224      225       +1     
  Lines        9801     9838      +37     
==========================================
+ Hits         7412     7449      +37     
  Misses       2389     2389              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xsahil03x xsahil03x changed the title feat(thumb): add StreamThumbnailSource to say where a video comes from feat(thumb)!: replace the video string with StreamThumbnailSource Nov 25, 2026
@xsahil03x
xsahil03x added this pull request to stack #262 November 25, 2026 14:31
xsahil03x and others added 5 commits November 25, 2026 16:04
Callers now pass a StreamThumbnailSource (network URL, local file or
Android content URI) instead of a bare string, and every platform opens
the video according to that kind. The String `video`/`videos`/`headers`
parameters are deprecated and keep working.

Also brings the example app's Android toolchain up to what current
Flutter requires, and fixes Android 10+ failing to thumbnail a local
video when maxWidth or maxHeight is 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`video`, `videos` and `headers` are removed rather than deprecated, so
every caller has to say where a video comes from. `source` and
`sources` are now required.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A file source naming a host fails with UNSUPPORTED_SOURCE on every
platform, Windows only opens absolute drive-letter paths, and Linux
applies the single-file container whitelist to files as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Keep headers internal and copy them into an unmodifiable map.
- Check every source kind explicitly, and reuse the shared check on web.
- File the narrowed inputs under breaking changes, matching the
  changelog's existing headings, and correct the README notes.
- Reach the Windows file-path check from the integration tests, and
  give each unit-test input its own test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@xsahil03x
xsahil03x force-pushed the feat/thumbnail-source branch from 5e24bf9 to d6eebe8 Compare November 25, 2026 15:04
@github-actions github-actions Bot added approved Approved by a reviewer and removed ready Pull request ready to be reviewed labels Nov 25, 2026
@xsahil03x
xsahil03x merged commit fee8317 into main Nov 26, 2026
24 checks passed
@xsahil03x
xsahil03x deleted the feat/thumbnail-source branch November 26, 2026 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Approved by a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants